home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Windows.h < prev   
Text File  |  1991-04-17  |  9KB  |  301 lines

  1. /************************************************************
  2.  
  3. Created: Saturday, December 15, 1990 at 4:31 PM
  4.     Windows.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1985-1990
  9.         All rights reserved.
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __WINDOWS__
  15. #define __WINDOWS__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #ifndef __EVENTS__
  22. #include <Events.h>
  23. #endif
  24.  
  25. #ifndef __CONTROLS__
  26. #include <Controls.h>
  27. #endif
  28.  
  29.  
  30. enum {
  31.  
  32.     documentProc = 0,
  33.     dBoxProc = 1,
  34.     plainDBox = 2,
  35.     altDBoxProc = 3,
  36.     noGrowDocProc = 4,
  37.     movableDBoxProc = 5,
  38.     zoomDocProc = 8,
  39.     zoomNoGrow = 12,
  40.     rDocProc = 16,
  41.     dialogKind = 2,
  42.     userKind = 8,
  43.  
  44. /*FindWindow Result Codes*/
  45.     inDesk = 0,
  46.     inMenuBar = 1,
  47.     inSysWindow = 2,
  48.     inContent = 3,
  49.     inDrag = 4,
  50.     inGrow = 5,
  51.     inGoAway = 6,
  52.     inZoomIn = 7,
  53.     inZoomOut = 8
  54. };
  55. enum {
  56.  
  57. /*window messages*/
  58.     wDraw = 0,
  59.     wHit = 1,
  60.     wCalcRgns = 2,
  61.     wNew = 3,
  62.     wDispose = 4,
  63.     wGrow = 5,
  64.     wDrawGIcon = 6,
  65.  
  66. /*defProc hit test codes*/
  67.     wNoHit = 0,
  68.     wInContent = 1,
  69.     wInDrag = 2,
  70.     wInGrow = 3,
  71.     wInGoAway = 4,
  72.     wInZoomIn = 5,
  73.     wInZoomOut = 6,
  74.     deskPatID = 16,
  75.  
  76. /*Window Part Identifiers which correlate color table entries with window elements*/
  77.     wContentColor = 0,
  78.     wFrameColor = 1,
  79.     wTextColor = 2,
  80.     wHiliteColor = 3,
  81.     wTitleBarColor = 4
  82. };
  83.  
  84.  
  85. typedef pascal void (*DragGrayRgnProcPtr)(void);
  86.  
  87. struct WindowRecord {
  88.     GrafPort port;
  89.     short windowKind;
  90.     Boolean visible;
  91.     Boolean hilited;
  92.     Boolean goAwayFlag;
  93.     Boolean spareFlag;
  94.     RgnHandle strucRgn;
  95.     RgnHandle contRgn;
  96.     RgnHandle updateRgn;
  97.     Handle windowDefProc;
  98.     Handle dataHandle;
  99.     StringHandle titleHandle;
  100.     short titleWidth;
  101.     ControlHandle controlList;
  102.     struct WindowRecord *nextWindow;
  103.     PicHandle windowPic;
  104.     long refCon;
  105. };
  106.  
  107. typedef struct WindowRecord WindowRecord;
  108. typedef WindowRecord *WindowPeek;
  109.  
  110.  
  111. struct CWindowRecord {
  112.     CGrafPort port;
  113.     short windowKind;
  114.     Boolean visible;
  115.     Boolean hilited;
  116.     Boolean goAwayFlag;
  117.     Boolean spareFlag;
  118.     RgnHandle strucRgn;
  119.     RgnHandle contRgn;
  120.     RgnHandle updateRgn;
  121.     Handle windowDefProc;
  122.     Handle dataHandle;
  123.     StringHandle titleHandle;
  124.     short titleWidth;
  125.     ControlHandle controlList;
  126.     struct CWindowRecord *nextWindow;
  127.     PicHandle windowPic;
  128.     long refCon;
  129. };
  130.  
  131. typedef struct CWindowRecord CWindowRecord;
  132. typedef CWindowRecord *CWindowPeek;
  133.  
  134.  
  135. struct WStateData {
  136.     Rect userState;             /*user state*/
  137.     Rect stdState;              /*standard state*/
  138. };
  139.  
  140. typedef struct WStateData WStateData;
  141. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  142.  
  143.  
  144. struct AuxWinRec {
  145.     struct AuxWinRec **awNext;  /*handle to next AuxWinRec*/
  146.     WindowPtr awOwner;          /*ptr to window */
  147.     CTabHandle awCTable;        /*color table for this window*/
  148.     Handle dialogCItem;         /*handle to dialog manager structures*/
  149.     long awFlags;               /*reserved for expansion*/
  150.     CTabHandle awReserved;      /*reserved for expansion*/
  151.     long awRefCon;              /*user Constant*/
  152. };
  153.  
  154. typedef struct AuxWinRec AuxWinRec;
  155. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  156.  
  157.  
  158. struct WinCTab {
  159.     long wCSeed;                /*reserved*/
  160.     short wCReserved;           /*reserved*/
  161.     short ctSize;               /*usually 4 for windows*/
  162.     ColorSpec ctTable[5];
  163. };
  164.  
  165. typedef struct WinCTab WinCTab;
  166. typedef WinCTab *WCTabPtr, **WCTabHandle;
  167.  
  168.  
  169.  
  170. #ifdef __cplusplus
  171. extern "C" {
  172. #endif
  173. pascal void InitWindows(void)
  174.     = 0xA912; 
  175. pascal void GetWMgrPort(GrafPtr *wPort)
  176.     = 0xA910; 
  177. pascal WindowPtr NewWindow(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  178.     Boolean visible,short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon)
  179.     = 0xA913; 
  180. pascal WindowPtr GetNewWindow(short windowID,void *wStorage,WindowPtr behind)
  181.     = 0xA9BD; 
  182. pascal void CloseWindow(WindowPtr theWindow)
  183.     = 0xA92D; 
  184. pascal void DisposeWindow(WindowPtr theWindow)
  185.     = 0xA914; 
  186. void setwtitle(WindowPtr theWindow,char *title); 
  187. pascal void GetWTitle(WindowPtr theWindow,Str255 title)
  188.     = 0xA919; 
  189. pascal void SelectWindow(WindowPtr theWindow)
  190.     = 0xA91F; 
  191. pascal void HideWindow(WindowPtr theWindow)
  192.     = 0xA916; 
  193. pascal void ShowWindow(WindowPtr theWindow)
  194.     = 0xA915; 
  195. pascal void ShowHide(WindowPtr theWindow,Boolean showFlag)
  196.     = 0xA908; 
  197. pascal void HiliteWindow(WindowPtr theWindow,Boolean fHilite)
  198.     = 0xA91C; 
  199. pascal void BringToFront(WindowPtr theWindow)
  200.     = 0xA920; 
  201. pascal void SendBehind(WindowPtr theWindow,WindowPtr behindWindow)
  202.     = 0xA921; 
  203. pascal WindowPtr FrontWindow(void)
  204.     = 0xA924; 
  205. pascal void DrawGrowIcon(WindowPtr theWindow)
  206.     = 0xA904; 
  207. pascal void MoveWindow(WindowPtr theWindow,short hGlobal,short vGlobal,
  208.     Boolean front)
  209.     = 0xA91B; 
  210. pascal void SizeWindow(WindowPtr theWindow,short w,short h,Boolean fUpdate)
  211.     = 0xA91D; 
  212. pascal void ZoomWindow(WindowPtr theWindow,short partCode,Boolean front)
  213.     = 0xA83A; 
  214. pascal void InvalRect(const Rect *badRect)
  215.     = 0xA928; 
  216. pascal void InvalRgn(RgnHandle badRgn)
  217.     = 0xA927; 
  218. pascal void ValidRect(const Rect *goodRect)
  219.     = 0xA92A; 
  220. pascal void ValidRgn(RgnHandle goodRgn)
  221.     = 0xA929; 
  222. pascal void BeginUpdate(WindowPtr theWindow)
  223.     = 0xA922; 
  224. pascal void EndUpdate(WindowPtr theWindow)
  225.     = 0xA923; 
  226. pascal void SetWRefCon(WindowPtr theWindow,long data)
  227.     = 0xA918; 
  228. pascal long GetWRefCon(WindowPtr theWindow)
  229.     = 0xA917; 
  230. pascal void SetWindowPic(WindowPtr theWindow,PicHandle pic)
  231.     = 0xA92E; 
  232. pascal PicHandle GetWindowPic(WindowPtr theWindow)
  233.     = 0xA92F; 
  234. pascal Boolean CheckUpdate(EventRecord *theEvent)
  235.     = 0xA911; 
  236. pascal void ClipAbove(WindowPeek window)
  237.     = 0xA90B; 
  238. pascal void SaveOld(WindowPeek window)
  239.     = 0xA90E; 
  240. pascal void DrawNew(WindowPeek window,Boolean update)
  241.     = 0xA90F; 
  242. pascal void PaintOne(WindowPeek window,RgnHandle clobberedRgn)
  243.     = 0xA90C; 
  244. pascal void PaintBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  245.     = 0xA90D; 
  246. pascal void CalcVis(WindowPeek window)
  247.     = 0xA909; 
  248. pascal void CalcVisBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  249.     = 0xA90A; 
  250. pascal long GrowWindow(WindowPtr theWindow,Point startPt,const Rect *bBox)
  251.     = 0xA92B; 
  252. Boolean trackgoaway(WindowPtr theWindow,Point *thePt); 
  253. pascal short FindWindow(Point thePoint,WindowPtr *theWindow)
  254.     = 0xA92C; 
  255. short findwindow(Point *thePoint,WindowPtr *theWindow); 
  256. pascal long PinRect(const Rect *theRect,Point thePt)
  257.     = 0xA94E; 
  258. pascal long DragGrayRgn(RgnHandle theRgn,Point startPt,const Rect *boundsRect,
  259.     const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc)
  260.     = 0xA905; 
  261. pascal Boolean TrackBox(WindowPtr theWindow,Point thePt,short partCode)
  262.     = 0xA83B; 
  263. pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  264.     = 0xAA48; 
  265. void getwtitle(WindowPtr theWindow,char *title); 
  266. pascal void SetWinColor(WindowPtr theWindow,WCTabHandle newColorTable)
  267.     = 0xAA41; 
  268. pascal Boolean GetAuxWin(WindowPtr theWindow,AuxWinHandle *awHndl)
  269.     = 0xAA42; 
  270. long growwindow(WindowPtr theWindow,Point *startPt,const Rect *bBox); 
  271. pascal void SetDeskCPat(PixPatHandle deskPixPat)
  272.     = 0xAA47; 
  273. WindowPtr newwindow(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  274.     short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  275. pascal WindowPtr NewCWindow(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  276.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon)
  277.     = 0xAA45; 
  278. WindowPtr newcwindow(void *wStorage,const Rect *boundsRect,char *title,
  279.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  280. pascal WindowPtr GetNewCWindow(short windowID,void *wStorage,WindowPtr behind)
  281.     = 0xAA46; 
  282. pascal short GetWVariant(WindowPtr theWindow)
  283.     = 0xA80A; 
  284. long pinrect(const Rect *theRect,Point *thePt); 
  285. #define GetGrayRgn() (* (RgnHandle*) 0x09EE)
  286. pascal void SetWTitle(WindowPtr theWindow,ConstStr255Param title)
  287.     = 0xA91A; 
  288. Boolean trackbox(WindowPtr theWindow,Point *thePt,short partCode); 
  289. pascal Boolean TrackGoAway(WindowPtr theWindow,Point thePt)
  290.     = 0xA91E; 
  291. pascal void DragWindow(WindowPtr theWindow,Point startPt,const Rect *boundsRect)
  292.     = 0xA925; 
  293. long draggrayrgn(RgnHandle theRgn,Point *startPt,const Rect *boundsRect,
  294.     const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc); 
  295. void dragwindow(WindowPtr theWindow,Point *startPt,const Rect *boundsRect); 
  296. #ifdef __cplusplus
  297. }
  298. #endif
  299.  
  300. #endif
  301.